<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
        <style type="text/css">
        #box{
            width: 100px;
            height: 100px;
            border: 1px solid #F7EED6;
        }
    </style>
</head>
<body>
    <h1>获取页面中元素的标签属性</h1><hr>
    <button onclick="makeLong()">变化</button>
    <div id="box" style="color:orange"></div>
    <script>
        function makeLong(){
           var box = document.getElementById('box');
           box.style.backgroundColor = "blue";
           box.style.height = "1000px";
           console.log(box);
           console.log(box.style.height);// 仅仅能获取行内样式;
        }
    </script>
    
</body>
</html>